using System;
using Deepcode.Flux.Core.Codons;
using Deepcode.Flux.Core.Extensions;
using Deepcode.Flux.Core.Extensions.Codons;
using Deepcode.Flux.Core.Systems.Workflow.Bases;

namespace Deepcode.Flux.Core.Systems.Workflow.Codons
{
	/// <summary>
	/// <WorkflowHandler id="" name="" class=""/>
	/// Codon to represent a handler object
	/// </summary>
	[XmlCodonName("WorkflowHandler")]
	public class WorkflowHandlerCodon : AbstractCodon
	{
		[XmlCodonAttribute("name")]
		private string name = "";

		[XmlCodonAttribute("class")]
		private string _class = "";

		public override object BuildItem(object owner, System.Collections.ArrayList subItems)
		{
			Handler h = new Handler();
			h.ID	= this.ID;
			h.Name	= this.name;
			h.Class	= this._class;
			return h;
		}
	}
}
